import config from "@/config"
import http from "@/utils/request"
import { ApiResult } from '@/api/common/ApiResultType'
import { QueryProcessTaskNameDto, ProcessTaskName, ProcessTaskNameActiveDto } from './types'
import PageViewModel from '../common/PageViewType'
export default {
	/**
	 * 获取当前所有数据
	 */
	getlist: {
		url: `${config.API_URL}/ProcessTaskName/getlist`,
		name: "获取当前所有数据",
		post: async function () {
			var res: PageViewModel = await http.post(this.url);
			return res;
		}
	},
	/**
	 *  获取当前所有数据
	 */
	getAllList: {
		url: `${config.API_URL}/ProcessTaskName/getAllList`,
		name: "获取当前所有数据",
		get: async function () {
			var res: ApiResult = await http.get(this.url);
			return res;
		}
	},
	/**
	 * 保存数据
	 */
	save: {
		url: `${config.API_URL}/ProcessTaskName/save`,
		name: "保存数据",
		post: async function (data) {
			var res: ApiResult = await http.post(this.url, data);
			return res;
		}
	},
	/**
	 * 启用禁用
	 */
	active: {
		url: `${config.API_URL}/ProcessTaskName/active`,
		name: "启用禁用",
		post: async function (data: ProcessTaskNameActiveDto) {
			var res: ApiResult = await http.post(this.url, data);
			return res;
		}
	},
	/**
	  * 通过Id获取详细信息
	 */
	getRoleById: {
		url: `${config.API_URL}/ProcessTaskName/GetInfoById`,
		name: "通过Id获取详细信息",
		get: async function (Id: string) {
			var res: any = await http.get(this.url + "?Id=" + Id);
			return res;
		}
	}
}
